function formatMonth(shijianchuo)
{
	//shijianchuo是整数，否则要parseInt转换
	var time = new Date(shijianchuo);
	var y = time.getFullYear();
	var m = time.getMonth()+1;
	var d = time.getDate();
	var h = time.getHours();
	var mm = time.getMinutes();
	var s = time.getSeconds();
	return m+'月'+d+'日';
}
function formatYear(shijianchuo)
{
	//shijianchuo是整数，否则要parseInt转换
	var time = new Date(shijianchuo);
	var y = time.getFullYear();
	var m = time.getMonth()+1;
	var d = time.getDate();
	var h = time.getHours();
	var mm = time.getMinutes();
	var s = time.getSeconds();
	return y + '.' + add0(m)+'.'+add0(d);
}
function add0(m){return m<10?'0'+m:m }

//获取cookie
function getCookie(name) {
	//web中cookie是以分号+空格隔开的
	var res = document.cookie.split('; ');
	for (let i = 0; i < res.length; i++)
		if (res[i].split('=')[0] === name) return res[i].split('=')[1];
		//未找到
	return '';
}
function setCookie(name, value, iTime) { //name是cookie中的名，value是其值，iTime来预定过期的时间（以天为单位）
	var iDate = new Date();
	iDate.setDate(iDate.getDate() + iTime); //以天为单位,存储是需要将Date对象存储为格林威治时间形式的字符串
	document.cookie = name + '=' + value + ';expires=' + iDate.toGMTString();
}
function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
	var r = window.location.search.substr(1).match(reg);  //匹配目标参数
	if (r != null) return encodeURI(r[2]); return ''; //返回参数值
}
function error(_class,error_txt){
	var _this = _class.parents('.lis');
	removerror(_class)
	return _this.append('<div class="error">'+ error_txt+'</div>');
}
function removerror(_class){
	var _this = _class.parents('.lis');
	return _this.find('.error').remove();
}
